<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function getRandom(min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min; //含最大值，含最小值
        }
        var arr = ['岁超凡', '景玉龙', '杨启祥', '商烁', '丁家豪'];
        console.log(arr[getRandom(0, arr.length - 1)]);
        console.log(getRandom(0, 10));
    </script>
</body>
</html>